<template>
	<label>
		<input type="radio" v-model="activeComponent" :value="CompA">A
	</label>
	<label>
		<input type="radio" v-model="activeComponent" :value="CompB">B
	</label>
	<Transition name="fade" mode="out-in">
		<component :is="activeComponent"></component>
	</Transition>
</template>

<script setup>
	import { shallowRef } from "vue" 
	import CompA from "@/components/CompA.vue"
	import CompB from "@/components/CompB.vue"
	
	const activeComponent = shallowRef(CompA) 
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.fade-enter-active,
.fade-leave-active {
	transition: opacity 0.5s ease;
}
.fade-enter-from,
.fade-leave-to {
	opacity: 0;
}
</style>
